<?php

/**
 * DtReportPerDay form base class.
 *
 * @method DtReportPerDay getObject() Returns the current form's model object
 *
 * @package    DUYTAN
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseDtReportPerDayForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'date'                         => new sfWidgetFormInputHidden(),
      'ground_id'                    => new sfWidgetFormInputHidden(),
      'orders_count'                 => new sfWidgetFormInputText(),
      'success_orders_count'         => new sfWidgetFormInputText(),
      'auto_rejected_orders_count'   => new sfWidgetFormInputText(),
      'manual_rejected_orders_count' => new sfWidgetFormInputText(),
      'total_amount_count'           => new sfWidgetFormInputText(),
      'created_at'                   => new sfWidgetFormDateTime(),
      'updated_at'                   => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'date'                         => new sfValidatorChoice(array('choices' => array($this->getObject()->get('date')), 'empty_value' => $this->getObject()->get('date'), 'required' => false)),
      'ground_id'                    => new sfValidatorChoice(array('choices' => array($this->getObject()->get('ground_id')), 'empty_value' => $this->getObject()->get('ground_id'), 'required' => false)),
      'orders_count'                 => new sfValidatorInteger(array('required' => false)),
      'success_orders_count'         => new sfValidatorInteger(array('required' => false)),
      'auto_rejected_orders_count'   => new sfValidatorInteger(array('required' => false)),
      'manual_rejected_orders_count' => new sfValidatorInteger(array('required' => false)),
      'total_amount_count'           => new sfValidatorInteger(array('required' => false)),
      'created_at'                   => new sfValidatorDateTime(),
      'updated_at'                   => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('dt_report_per_day[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'DtReportPerDay';
  }

}
